<?php
namespace EasyVote\EasyVoteBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\Persistence\ObjectManager;
use EasyVote\EasyVoteBundle\Entity\Gender;

/**
 * Class LoadGenderData
 * Loads gender info
 * @package EasyVote\EasyVoteBundle\DataFixtures\ORM
 */
class LoadGenderData extends AbstractFixture implements OrderedFixtureInterface
{
    /**
     * {@inheritDoc}
     */
    public function load(ObjectManager $manager)
    {
        $male = new Gender();
        $male->setName("Male");
        $manager->persist($male);
        $manager->flush();

        $female = new Gender();
        $female->setName("Female");
        $manager->persist($female);
        $manager->flush();
    }

    /**
     * {@inheritDoc}
     */
    public function getOrder()
    {
        return 5; // the order in which fixtures will be loaded
    }
}

?>
